/* ============================================================
   CarZoon Auth & Profile Styles
   Login · Signup · Profile Page
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Page wrapper ── */
.czauth-wrap {
    max-width: 560px;
    margin: 40px auto;
    padding: 0 16px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ─────────────────────────────────────────────────────────
   TAB SWITCHER
───────────────────────────────────────────────────────── */
.czauth-tabs {
    display: flex;
    position: relative;
    background: #f1f5fb;
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 28px;
    gap: 4px;
}
.czauth-tab {
    flex: 1;
    padding: 11px 10px;
    background: transparent;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b !important;
    cursor: pointer;
    transition: color 0.2s;
    position: relative;
    z-index: 2;
    font-family: inherit;
}
.czauth-tab.is-active {
    color: #0f2744 !important;
}
.czauth-tab-indicator {
    position: absolute;
    top: 5px;
    height: calc(100% - 10px);
    width: calc(50% - 7px);
    background: #fff;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(15,39,68,0.10);
    transition: left 0.25s cubic-bezier(.4,0,.2,1);
    z-index: 1;
    left: 5px; /* overridden by JS */
}
.czauth-wrap[data-tab="login"]  .czauth-tab-indicator { left: 5px; }
.czauth-wrap[data-tab="signup"] .czauth-tab-indicator { left: calc(50% + 2px); }

/* ─────────────────────────────────────────────────────────
   FLASH MESSAGE
───────────────────────────────────────────────────────── */
.czauth-flash {
    padding: 13px 16px;
    border-radius: 11px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.czauth-flash.is-success {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    color: #166534 !important;
}
.czauth-flash.is-error {
    background: #fff1f2;
    border: 1.5px solid #fecdd3;
    color: #9f1239 !important;
}

/* ─────────────────────────────────────────────────────────
   PANELS  (login / signup)
───────────────────────────────────────────────────────── */
.czauth-panel {
    display: none;
}
.czauth-panel.is-active {
    display: block;
}
.czauth-panel-inner {
    background: #fff;
    border-radius: 22px;
    padding: 36px 36px 32px;
    box-shadow: 0 4px 32px rgba(15,39,68,0.09);
    border: 1.5px solid #e8edf8;
}

/* Panel header */
.czauth-panel-header {
    text-align: center;
    margin-bottom: 28px;
}
.czauth-logo-icon {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}
.czauth-title {
    font-size: 22px;
    font-weight: 900;
    color: #0f172a !important;
    margin: 0 0 6px;
    line-height: 1.2;
}
.czauth-subtitle {
    font-size: 14px;
    color: #64748b !important;
    margin: 0;
}

/* ─────────────────────────────────────────────────────────
   FORM ELEMENTS
───────────────────────────────────────────────────────── */
.czauth-form { display: flex; flex-direction: column; gap: 0; }

.czauth-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 16px;
}
.czauth-label {
    font-size: 13px;
    font-weight: 700;
    color: #374151 !important;
    letter-spacing: 0.2px;
}
.czauth-req { color: #e53e3e !important; }

.czauth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.czauth-input-icon {
    position: absolute;
    left: 13px;
    font-size: 15px;
    pointer-events: none;
    line-height: 1;
}
.czauth-input-wrap .czauth-input { padding-left: 38px; }

.czauth-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 11px;
    font-size: 14px;
    color: #0f172a !important;
    background: #f8fafc;
    font-family: inherit;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.czauth-input:focus {
    border-color: #2f68ff !important;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(47,104,255,0.10);
}
.czauth-input::placeholder { color: #a0aec0 !important; }
.czauth-input-disabled {
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
}
.czauth-hint {
    font-size: 11.5px;
    color: #94a3b8 !important;
    margin-top: 3px;
}

.czauth-pwd-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #64748b !important;
    padding: 4px;
}

/* 2-column grid */
.czauth-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Remember-me / terms row */
.czauth-row-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.czauth-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151 !important;
    cursor: pointer;
}
.czauth-check {
    width: 16px; height: 16px;
    accent-color: #2f68ff;
    cursor: pointer;
    flex-shrink: 0;
}
.czauth-terms-check {
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}
.czauth-link-sm {
    font-size: 13px;
    color: #2f68ff !important;
    text-decoration: none;
    font-weight: 600;
}
.czauth-link-sm:hover { text-decoration: underline; }

/* Field error text */
.czauth-field-error {
    font-size: 12px;
    color: #e53e3e !important;
    font-weight: 500;
    display: none;
    margin-top: 2px;
}
.czauth-field-error.is-visible { display: block; }

/* ─────────────────────────────────────────────────────────
   ROLE SELECTOR CARDS
───────────────────────────────────────────────────────── */
.czauth-role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}
.czauth-role-card {
    cursor: pointer;
    position: relative;
}
.czauth-role-radio { position: absolute; opacity: 0; pointer-events: none; }
.czauth-role-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px 13px;
    border: 2px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    text-align: center;
    transition: border-color 0.18s, background 0.18s;
}
.czauth-role-radio:checked + .czauth-role-inner {
    border-color: #2f68ff;
    background: #eff6ff;
}
.czauth-role-icon  { font-size: 26px; margin-bottom: 2px; }
.czauth-role-name  { font-size: 13px; font-weight: 700; color: #0f172a !important; }
.czauth-role-desc  { font-size: 11px; color: #64748b !important; line-height: 1.3; }

/* ─────────────────────────────────────────────────────────
   PASSWORD STRENGTH
───────────────────────────────────────────────────────── */
.czauth-strength-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -8px 0 14px;
}
.czauth-strength-bar {
    flex: 1;
    height: 5px;
    background: #e2e8f0;
    border-radius: 99px;
    overflow: hidden;
}
.czauth-strength-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s, background 0.3s;
    width: 0%;
}
.czauth-strength-label {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    min-width: 52px;
    text-align: right;
}

/* ─────────────────────────────────────────────────────────
   BUTTON
───────────────────────────────────────────────────────── */
.czauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 13px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.18s, transform 0.12s;
    letter-spacing: 0.3px;
    margin-top: 4px;
}
.czauth-btn:active { transform: scale(0.98); }
.czauth-btn-primary {
    background: #0f2744;
    color: #fff;
}
.czauth-btn-primary:hover { background: #1a3d6e; }
.czauth-btn:disabled { opacity: 0.65; cursor: not-allowed; }

/* ─────────────────────────────────────────────────────────
   SWITCH TEXT
───────────────────────────────────────────────────────── */
.czauth-switch-text {
    text-align: center;
    font-size: 13.5px;
    color: #64748b !important;
    margin: 20px 0 0;
}
.czauth-switch-link {
    background: none;
    border: none;
    color: #2f68ff !important;
    font-weight: 700;
    cursor: pointer;
    font-size: 13.5px;
    font-family: inherit;
    padding: 0;
    text-decoration: none;
}
.czauth-switch-link:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────
   PROFILE PAGE
───────────────────────────────────────────────────────── */
.czpro-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header card */
.czpro-header-card {
    background: #0f2744;
    border-radius: 20px;
    padding: 30px 32px;
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    color: #fff;
    position: relative;
}
.czpro-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #2f68ff;
    color: #fff !important;
    font-size: 26px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid rgba(255,255,255,0.2);
}
.czpro-header-info { flex: 1; min-width: 180px; }
.czpro-display-name {
    font-size: 22px;
    font-weight: 900;
    margin: 0 0 6px;
    color: #fff !important;
    line-height: 1.2;
}
.czpro-role-badge {
    display: inline-block;
    background: rgba(47,104,255,0.25);
    border: 1px solid rgba(47,104,255,0.5);
    color: #93c5fd !important;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 11px;
    border-radius: 99px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.czpro-email, .czpro-phone {
    font-size: 13px;
    color: rgba(255,255,255,0.7) !important;
    margin-top: 3px;
}
.czpro-logout-btn {
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.2);
    color: #fff !important;
    border-radius: 11px;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.18s;
    flex-shrink: 0;
}
.czpro-logout-btn:hover { background: rgba(255,255,255,0.22); }

/* Stats row */
.czpro-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.czpro-stat {
    background: #fff;
    border: 1.5px solid #e8edf8;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
}
.czpro-stat-num {
    font-size: 32px;
    font-weight: 900;
    color: #0f172a !important;
    line-height: 1;
    margin-bottom: 6px;
}
.czpro-stat-green { color: #059669 !important; }
.czpro-stat-amber { color: #d97706 !important; }
.czpro-stat-label { font-size: 13px; color: #64748b !important; font-weight: 600; }

/* 2-col grid */
.czpro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.czpro-card {
    background: #fff;
    border: 1.5px solid #e8edf8;
    border-radius: 20px;
    padding: 26px 28px;
}
.czpro-card-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a !important;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1.5px solid #f1f5f9;
}
.czpro-form .czauth-btn { margin-top: 8px; }
.czpro-flash { margin-bottom: 16px; }

/* Quick actions */
.czpro-actions { display: flex; flex-direction: column; gap: 10px; }
.czpro-action-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1.5px solid #e8edf8;
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.czpro-action-link:hover {
    border-color: #2f68ff !important;
    box-shadow: 0 4px 16px rgba(47,104,255,0.08);
}
.czpro-action-icon { font-size: 24px; flex-shrink: 0; }
.czpro-action-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.czpro-action-text strong { font-size: 14px; font-weight: 700; color: #0f172a !important; }
.czpro-action-text small  { font-size: 12px; color: #64748b !important; }
.czpro-action-arrow { font-size: 20px; color: #94a3b8 !important; font-weight: 700; }

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .czauth-panel-inner { padding: 24px 20px 22px; }
    .czauth-grid-2      { grid-template-columns: 1fr; }
    .czauth-role-selector { grid-template-columns: 1fr 1fr; }
    .czpro-grid         { grid-template-columns: 1fr; }
    .czpro-stats        { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .czpro-header-card  { padding: 22px 20px; }
}
@media (max-width: 400px) {
    .czauth-role-selector { grid-template-columns: 1fr; }
    .czpro-stats          { grid-template-columns: 1fr; }
}
